package com.example.studentportrait.controller.frontend.teacher;

import com.example.studentportrait.domain.ResponseResult;
import com.example.studentportrait.domain.dto.AnnouncementListDto;
import com.example.studentportrait.domain.entity.Announcement;
import com.example.studentportrait.domain.entity.Item;
import com.example.studentportrait.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/teacher")
public class ItemController {

    @Autowired
    ItemService itemService;

    /**
     * 教师端查询项目列表
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    @GetMapping("/itemList")
    public ResponseResult itemList(Integer pageNum, Integer pageSize, Integer status){
        return itemService.itemList(pageNum,  pageSize,  status);
    }

    /**
     * 教师端审核项目
     * @param item
     * @return
     */
    @PutMapping("/reviewItemById")
    public ResponseResult<Item> reviewItemById(@RequestBody Item item){
        return itemService.reviewItemById(item);
    }
}
